package com.fau.fm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 地址省实体类
 * @author kangyj
 * @datetime 2014年11月8日,下午4:59:14
 */
@Entity
@Table(name = "medical_province")
public class MedicalProvince implements Serializable, JSONAware {

	private static final long serialVersionUID = -6717292441976722622L;
	
	private String id;			// 省份id
	private String pName;		// 省份名称
	
	@Id
	@GenericGenerator(name = "generator", strategy = "assigned")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 20)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "p_name", length = 50)
	public String getpName() {
		return pName;
	}
	public void setpName(String pName) {
		this.pName = pName;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("id", id);
		obj.put("pName", pName);
		return obj.toString();
	}

}
